cmake_minimum_required(VERSION 3.16)
project(Network LANGUAGES CXX)

include(qt.cmake)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR}
    COMPONENTS
        Core
        Gui
        Widgets
        Network
)
qt_standard_project_setup()

set(PROJECT_SOURCES
    main.cpp
    network.ui
    network.h
    network.cpp
)

set(HTTPCLASS   
    httpget.h
    httpget.cpp
)

qt_add_executable(Network ${PROJECT_SOURCES} ${HTTPCLASS})

set_target_properties(Network
    PROPERTIES
        WIN32_EXECUTABLE TRUE
)

target_link_libraries(Network
    PUBLIC
        Qt::Core
        Qt::Gui
        Qt::Widgets
        Qt::Network
)
